#ifndef RTPSENDER_H
#define RTPSENDER_H

#endif // RTPSENDER_H

#pragma once
#include <QUdpSocket>
#include <QThread>
#include <QFile>

class RtpSender : public QThread {
    Q_OBJECT
public:
    explicit RtpSender(quint16 clientPort, quint16 serverPort,QString filePath);

private:
    QByteArray getNextNalUnit(QFile& file);

    QByteArray buildRtpPacket(const QByteArray& nal, quint8 payloadType,
                              quint16 seqNum, quint32 timestamp, quint32 ssrc);

    void RtpSendSimpleTest(QUdpSocket *  socket);

protected:
    void run() override;

private:
    quint16 m_clientPort; //RTP目标端口，需与SETUP响应一致
    quint16 m_serverPort; //RTP发送源端口，需与SETUP响应一致
    QString m_filePath;

};
